#ifndef EVENTLOOPTHREADPOLL_H
#define EVENTLOOPTHREADPOLL_H
#pragma once
#include <vector>
#include <memory>
#include "../prohibitassignment.h"
#include "eventthread.h"

/**
 * 事件循环线程池
 * @brief The EventLoopThreadPoll class
 */
class EventLoopThreadPool : ProhibitAssignment
{
public:
    EventLoopThreadPool(EventLoop* baseLoop, int numThreads);

    ~EventLoopThreadPool()
    {
//        LOG << "~EventLoopThreadPool()";
    }
    void start();

    EventLoop *getNextLoop();

private:
    EventLoop* baseLoop_;
    bool started_;
    int numThreads_;
    int next_;
    std::vector<std::shared_ptr<EventThread>> threads_;
    std::vector<EventLoop*> loops_;
};

#endif // EVENTLOOPTHREADPOLL_H
